package com.fr.report.cellElement;

import com.fr.base.XMLable;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;
import com.fr.report.io.xml.ReportXMLUtils;

public class CellInsertPolicyAttr
  implements XMLable
{
  public static String XML_TAG = "CellInsertPolicy";
  public static String INSERT_POLICY_NULL = "null";
  public static String INSERT_POLICY_DEFAULT = "default";
  public static String INSERT_POLICY_COPY = "copy";
  private String insertPolicy = INSERT_POLICY_NULL;
  private Object defaultInsertValue = null;

  public String getInsertPolicy()
  {
    return this.insertPolicy;
  }

  public void setInsertPolicy(String paramString)
  {
    this.insertPolicy = paramString;
  }

  public Object getDefaultInsertValue()
  {
    return this.defaultInsertValue;
  }

  public void setDefaultInsertValue(Object paramObject)
  {
    this.defaultInsertValue = paramObject;
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    if (paramXMLableReader.isChildNode())
    {
      String str1 = paramXMLableReader.getTagName();
      if ("InsertPolicy".equals(str1))
      {
        String str2;
        if ((str2 = paramXMLableReader.getElementValue()) != null)
          setInsertPolicy(str2);
      }
      else if (("Object".equals(str1)) || ("O".equals(str1)))
      {
        setDefaultInsertValue(ReportXMLUtils.readObject(paramXMLableReader));
      }
    }
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    paramXMLPrintWriter.startTAG(XML_TAG);
    if (!("null".equals(this.insertPolicy)))
      paramXMLPrintWriter.startTAG("InsertPolicy").textNode(this.insertPolicy).end();
    if (this.defaultInsertValue != null)
      ReportXMLUtils.writeObject(paramXMLPrintWriter, this.defaultInsertValue);
    paramXMLPrintWriter.end();
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    return super.clone();
  }
}